package com.itgaoshu.hospitalproject.mapper;

import com.itgaoshu.hospitalproject.bean.Upplier;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UpplierMapper {
    //查询供货商的方法
    List<Upplier> findAllUpplier(String supplierName);
    //添加供货商的方法
    @Insert("insert into upplier(supplierId,supplierName) values(null,#{supplierName})")
    int addUpplier(String supplierName);
    //查询这个供货商存不存在的方法
    @Select("select count(1) from upplier where supplierName=#{supplierName}")
    int count(String supplierName);
    //删除供货商的方法
    @Delete("delete from upplier where supplierId=#{supplierId}")
    int deleteUpplier(int supplierId);
}
